﻿using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using MySql.Data;
using MySql.Data.MySqlClient;
using OnlineGame.src.Others;

namespace OnlineGame.src.Screens
{
    class CreateCharacter
    {
        SpriteFont tittleFont;

        Rectangle chooseBlack;
        Rectangle posBlack;

        Rectangle chooseCinza;
        Rectangle posCinza;

        Rectangle chooseLighBlue;
        Rectangle posLightBlue;

        Texture2D chooseColor;

       public CreateCharacter(ContentManager Content, GameWindow Window)
        {

           chooseColor = Content.Load<Texture2D>("BG");
           tittleFont = Content.Load<SpriteFont>("Arial40");

           posBlack = new Rectangle(150, 100, 100, 100);
           posCinza = new Rectangle(250, 100, 100, 100);
           posLightBlue = new Rectangle(350, 100, 100, 100);

           chooseBlack = new Rectangle(0, 0, 100, 100);
           chooseCinza = new Rectangle(300, 0, 100, 100);
           chooseLighBlue = new Rectangle(600, 0, 100, 100);
           

        }
        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(tittleFont, "Choose your Char Color",Vector2.Zero, Color.Yellow);



            spriteBatch.Draw(chooseColor, posBlack, chooseBlack, Color.White);
            spriteBatch.Draw(chooseColor, posCinza, chooseCinza, Color.White);
            spriteBatch.Draw(chooseColor, posLightBlue, chooseLighBlue, Color.White);
        }
        public void Update(GameTime gameTime, SpriteBatch spriteBatch,Rectangle mousePos)
        {
            if (Mouse.GetState().LeftButton == Microsoft.Xna.Framework.Input.ButtonState.Pressed)
            {
                if (mousePos.Intersects(posBlack))
                {
                    Server.CreateChar("Felipe", "RedSquad");
                }
                else if (mousePos.Intersects(posCinza))
                {
                    Server.CreateChar("Felipe", "CinzaSquad");
                }
                else if (mousePos.Intersects(posLightBlue))
                {
                    Server.CreateChar("Felipe", "BlueSquad");
                }
            }
        }


    }
}
